package generator

import (
	"kumachan/interpreter/lang/common/limits"
	rt "kumachan/interpreter/runtime/def"
)

var _ = (func() struct{} {
	// check consistency of limits
	var check = func(desc string, lang_limit uint, runtime_limit uint) {
		if !(lang_limit <= runtime_limit) {
			panic("inconsistent limit: " + desc)
		}
	}
	check("EnumSize",      limits.MaxEnumSize,            rt.MaxEnumCases)
	check("TupleSize",     limits.MaxTupleSize,           rt.MaxTupleElements)
	check("RecordSize",    limits.MaxRecordSize,          rt.MaxTupleElements)
	check("InterfaceSize", limits.MaxInterfaceSize,       rt.MaxInterfaceMethods)
	check("PatternArity",  limits.MaxProductPatternArity, rt.MaxArguments)
	check("SelectArity",   limits.MaxSelectArity,         rt.MaxSelectOperands)
	return struct{}{}
})


